package springcloud.controller;

import com.springcloud.entities.Person;
import com.springcloud.entities.ReturnResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springcloud.mapper.RoleDepartmentMapper;

import java.util.ArrayList;
import java.util.List;

@RestController
public class PaymentController {
    @Autowired
    RoleDepartmentMapper roleDepartmentMapper;

    @Value("${server.port}")
    private String serverPort;

    @GetMapping(value = "/test")
    public String test() {
        List<Person> list = roleDepartmentMapper.list();
        return "nacos registry, serverPort: " + serverPort+"     数据为:"+list;
    }
    @GetMapping(value = "/test")
    public ReturnResult test1() {
        ArrayList<Object> list = new ArrayList<>();
        return ReturnResult.success(list);
    }

}
